import java.io.IOException;

/**
 * 
 */

/**
 * @author annvcit
 * @full_name Nguyen Van Chuc An
 * @date_created Dec 20, 2014
 * @date_modified Dec 20, 2014
 * @email annvcit@gmail.com
 */
public class Demo {
	public static void main(String[] args) throws Exception {
		
		Runtime r = Runtime.getRuntime();
		String last = "";
//		last = "openssl genrsa -des3 -out ~/Desktop/server/prikey.key -passout pass:p 1024";
		last = "cd ~/Desktop/a && mkdir abc";
		String[] cmd = new String[]{"/bin/bash", "-c", last};
		Process p1 = r.exec(cmd);
		p1.waitFor();
//		System.out.println(p1.exitValue());
		/*p1.destroy();
		last = "openssl genrsa -des3 -out prikey.key 1024";
		cmd[2] = last;
		p1 = r.exec(cmd);
		p1.waitFor();*/
		
//		Runtime r2 = Runtime.getRuntime();
//		String last2 = "";
//		last2 = "mkdir ~/Desktop/server22";
//		String[] cmd2 = new String[]{"/bin/bash", "-c", last2};
//		Process p2 = r2.exec(cmd2);
//		p2.waitFor();
		
	}
}
